﻿using System;
using System.Collections.ObjectModel;
using Highcharts.Core;
using Highcharts.Core.Data.Chart;
using Highcharts.Core.PlotOptions;

namespace DemoWebforms
{
    public partial class Sample11 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Exemplo11();
        }

        private void Exemplo11()
        {
            
            //definições de eixos
            var yAxisItem = new YAxisItem { title = new Title("Faturamento") };
            yAxisItem.plotLines = new PlotLines
                                       {
                                           new PlotLine
                                               {
                                                   label = new PlotLabel {text = "Plot Line Label"},
                                                   value = 500,
                                                   dashStyle = DashStyle.Solid,
                                                   width = 2,
                                                   color = "#000"
                                               }
                                       };
            yAxisItem.plotBands = new PlotBands
                                       {
                                           new PlotBand
                                               {
                                                   label = new PlotLabel{text = "Plot Band Label", verticalAlign = VerticalAlign.bottom, y = -10},
                                                   from = 700,
                                                   to = 1000,
                                                   color = "#D6F5D6"
                                               }
                                       };

            hcVendas.YAxis.Add(yAxisItem);
            
            
            hcVendas.XAxis.Add(new XAxisItem { categories = new object[] { "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002" } });

            //Add data to serie
            var series = new Collection<Serie>();
            series.Add(new Serie { data = new object[] { 400, 435, 446, 479, 554, 634, 687, 750, 831 }});
            hcVendas.PlotOptions = new PlotOptionsLine { dataLabels = new DataLabels { enabled = true } };
            
            //Bind the control
            hcVendas.DataSource = series;
            hcVendas.DataBind();

        }

    }
}
